﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using GUI.Common;

namespace GUI.Admin
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected NhanVienDTO _nvDTO;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["NhanVien"] == null)
            {
                Response.Redirect("../Default.aspx");
            }
            else
            {
                _nvDTO = new NhanVienDTO();
                _nvDTO = (NhanVienDTO)Session["NhanVien"];
            }
        }

        protected string LoadFullDateTime(DateTime date)
        {
            return CommonClass.FormatFullDateTime(date);
        }

        protected void Menu1_Load(object sender, EventArgs e)
        {
            if (Session["Account"] != null)
            {


                NhanVienDTO _nvDTO = new NhanVienDTO();
                _nvDTO = (NhanVienDTO)Session["NhanVien"];

                if (_nvDTO.Quyen == 1) // Ban giám đốc
                {
                    //this.Menu1.Items[1].Visible = false;
                    //  this.Menu1.Items[2].Visible = false;
                    //   this.Menu1.Items[3].Visible = false;
                    //this.Menu1.Items[5].Visible = false;
                    //this.Menu1.Items[7].Visible = false;
                    //    this.Menu1.Items[8].Visible = false;
                    //    this.Menu1.Items[9].Visible = false;
                    //     this.Menu1.Items[10].Visible = false;
                    //     this.Menu1.Items[11].Visible = false;
                    return;
                }

                if (_nvDTO.Quyen == 2)
                {
                    //   this.Menu1.Items[2].SubMenu.Items[4].Visible = false;
                    return;
                }

            }

        }
    }
}